<template>
    <div>
        <main-title>
            <span slot="name">集群管理 / {{crumbs}}</span>
        </main-title>
        <router-view @change="setCrumbs"></router-view>
    </div>
</template>

<script>
import MainTitle from './common/MainTitle.vue';

export default {
    components: { MainTitle },
    data() {
        return {
            crumbs: '',
            meta: ''
        };
    },
    methods: {
        //判断路由name设置面包屑文案
        setCrumbs(name) {
            switch (name) {
                case 'list':
                    this.crumbs = '集群列表';
                    break;
                case 'add':
                    this.crumbs = '添加';
                    break;
                case 'edit':
                    this.crumbs = '编辑';
                    break;
                case 'detail':
                    this.crumbs = '节点详情';
                    break;
                case 'masterConfig':
                    this.crumbs = '节点详情 / 配置-管理节点';
                    break;
                case 'nodeConfig':
                    this.crumbs = '节点详情 / 配置-工作节点';
                    break;
                default:
                    break;
            }
        }
    }
};
</script>

<style scoped>
</style>